package com.kkb.shopcenter.server.impl;


import com.github.pagehelper.PageInfo;
import com.kkb.shopcenter.api.CategoryInfoService;
import com.kkb.shopcenter.common.pojo.CategoryInfo;
import com.kkb.shopcenter.server.mappers.CategoryInfoMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


@Service
public class CategoryInfoServiceImpl implements CategoryInfoService {

    @Autowired
    private CategoryInfoMapper categoryInfoMapper;

    @Override
    public List<CategoryInfo> selectCategoryList() {
        return categoryInfoMapper.selectAll();
    }

    @Override
    public PageInfo<CategoryInfo> selectAllCategory() {
        List<CategoryInfo> categoryInfos = categoryInfoMapper.selectAllCategory();
        PageInfo<CategoryInfo> pageInfo = new PageInfo<>(categoryInfos);
        return pageInfo;
    }

    @Override
    public List<CategoryInfo> selectCategoryLevel2() {
        return categoryInfoMapper.selectCategoryLevel2();
    }
}
